# -*- coding: utf-8 -*-
# @Time    : 2024/1/4  16:12
# @Author  : zhanghao
# @FileName: SignalUnit.py
# @Software: PyCharm
"""
    Description: 用作通知UI线程更新界面时的参数
"""
from helper.event_type import EventType
from api.domain.file_result import FileResult


class SignalUnit(object):
    event_type = EventType.NONE
    task_info: FileResult

    def __init__(self):
        pass

    def __str__(self):
        return f"SignalUnit(event_type={self.event_type}, task_info={self.task_info})"

    @staticmethod
    def build(event_type: EventType, task_info: FileResult):
        signal_unit = SignalUnit()
        signal_unit.event_type = event_type
        signal_unit.task_info = task_info

        return signal_unit

